<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="/WEB-INF/tld/showUpsAndWeight.tld" prefix="uw" %>  
<%@ taglib uri="/WEB-INF/tld/waybillStatus.tld" prefix="ws" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>消费记录</title>
		<link rel="stylesheet" type="text/css" href="btn_class.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/resources/css/ext-all.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/style.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/desktop.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/ext-patch.css" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<script type="text/javascript">
		<%String uId = (String) session.getAttribute("Uid");
			if (uId == null || uId.equals("null")) {%>
			window.parent.location.href = 'index.jsp';
		<%}%>
		function topage(currentPage){
			var f = document.forms["enterWaybillForm"];
			
			var accountAction = document.getElementsByName("accountAction")[0].value;
			if(accountAction != '') {
				f.action = "user!showConsumptionHistory.do?currentPage="+currentPage + "&action="+accountAction;
			} else {
				f.action = "user!showConsumptionHistory.do?currentPage="+currentPage;	
			}
			
			f.submit();
		}
		
		function viewDetail(id) {
			document.getElementsByName(id)[0].style.display="block";
		}

		function closeDetail(id) {
			document.getElementsByName(id)[0].style.display="none";
		}
		</script>
		<style type="text/css">
			.showValue6
			{
				background-color : white;
				color : #00309c;
			} 
			.bm
			{
				color : #0b5199;
				font-size : 12px;
				font-weight : bold;
			}
   		</style>
 
	</head>

	
<body style="background:white"> 
	<div class="x-panel-header x-panel-header-noborder x-unselectable" id="ext-gen8" style="mozuserselect: none; khtmluserselect: none;" unselectable="on">
		<span class="x-panel-header-text" >消费记录</span>
	</div>
	
	<table>
		<tr>
			<td width="200">
				<a href="/user!showConsumptionHistory.do" style="text-decoration:none">
					<c:if test="${accountAction==null}">
						<font color="red"><b>消费记录</b></font>
					</c:if>				
					<c:if test="${accountAction!=null}">
						消费记录
					</c:if>
				</a>			
			</td>
			<td width="200"><a href="/user!showConsumptionHistory.do?action=koukuan" style="text-decoration:none">
				<c:if test="${accountAction!='koukuan'}">
					扣款记录
				</c:if>				
				<c:if test="${accountAction=='koukuan'}">
					<font color="red"><b>扣款记录</b></font>
				</c:if>
				
			</a></td>
			<td width="200"><a href="/user!showConsumptionHistory.do?action=shoukuan" style="text-decoration:none">
				<c:if test="${accountAction!='shoukuan'}">
					充值记录
				</c:if>				
				<c:if test="${accountAction=='shoukuan'}">
					<font  color="red"><b>充值记录</b></font>
				</c:if>
			</a></td>
		</tr>
	</table>
	
	<form name="enterWaybillForm" method="post">
	<input name="accountAction" type="hidden" value="${accountAction}" />
	<table width="100%" border="0" cellSpacing="3" cellPadding="3">
		<tr><td align="center" bgColor="">		
			<table width="100%" style="border-bottom: #c2cbec 1px solid; border-left: #c2cbec 1px solid; border-top: #c2cbec 1px solid; border-right: #c2cbec 1px solid;" bgColor="#fafafa" border="0" cellSpacing="0" cellPadding="0">
			 	<tr align="center">
			 		<td width="4%" height="28" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>序号</b></td>
			 		<td width="17%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>操作日期</b></td>
			 		<td width="17%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>涉及单号</b></td>
			 		<td width="17%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>账户动作</b></td>
			 		<td width="17%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>金额</b></td>
			 		<td width="17%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>类别</b></td>
			 		<td width="11%" background="images/om.gif" style="border-right: #c2cbec 1px solid;"><b>查看</b></td>
			 	</tr>
			 	<s:iterator id="wb" value="consumptionHistory" status='st'>
			 	<tr align="center" class="showValue6" style="line-height: 120%;">
			 		<td height="26" style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
			 			<s:property value='#st.index + 1 + ${(pageView.currentpage-1)*20}'/>&nbsp;
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
			 			<s:property value="#wb.operationTime"/>&nbsp;
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
			 			<s:property value="#wb.wbId"/>&nbsp;
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
			 			<!-- <s:property value="#wb.accountAction"/>&nbsp;-->
			 			<c:if   test= "${wb.accountAction == 'shoukuan'}"> 
							 收款
						</c:if>
						<c:if   test= "${wb.accountAction == 'koukuan'}"> 
							 扣款
						</c:if>
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
			 			<s:property value="#wb.amount"/>&nbsp;
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid;">
						<c:if   test= "${wb.operateType == 'zhifubaochongzhi'}"> 
							 支付宝充值
						</c:if>
						<c:if   test= "${wb.operateType == 'xitongkoukuan'}"> 
							 系统扣款
						</c:if>
						<c:if   test= "${wb.operateType == 'tuijianyonghu'}"> 
							 推荐用户奖励
						</c:if>
						
			 		</td>
			 		<td style="border-bottom: #c6def0 1px solid; border-top: #999999 1px solid; border-right: #c6def0 1px solid; align:center">
			 			<a href="#" onclick="viewDetail('${wb.id}')">详细</a>
			 		</td>
			 	</tr>
			 	
			 	<c:if test="${wb.operateType == 'zhifubaochongzhi'}"> 
				 	<tr id="${wb.id}" style="display:none">
				 		<td align="center">备注</td>
				 		<td colspan="5">
				 			<s:property value="#wb.id"/>&nbsp<s:property value="#wb.operationTime"/>&nbsp;
				 			通过支付宝在线充值￥<s:property value="#wb.amount"/>元，交易号：<s:property value="#wb.id"/>
				 		</td>
				 		<td align="center">
				 			<a href="#" onclick="closeDetail('${wb.id}')">关闭</a>
				 		</td>
				 	</tr>
			 	</c:if>
			 	<c:if test="${wb.operateType == 'xitongkoukuan'}">
			 		 <tr id="${wb.id}" style="display:none">
			 		 	<td align="center">备注</td>
				 		<td colspan="5">
				 			系统结算运费，自动扣款！
				 		</td>
				 		<td align="center">
				 			<a href="#" onclick="closeDetail('${wb.id}')">关闭</a>
				 		</td>
			 		 </tr>
			 	</c:if>	 
			 	 	<c:if test="${wb.operateType == 'tuijianyonghu'}">
			 		 <tr id="${wb.id}" style="display:none">
			 		 	<td align="center">备注</td>
				 		<td colspan="5">
				 			推荐用户奖励，谢谢您的支持
				 		</td>
				 		<td align="center">
				 			<a href="#" onclick="closeDetail('${wb.id}')">关闭</a>
				 		</td>
			 		 </tr>
			 	</c:if>	 	
			 </s:iterator>
			 </table>
			</td>
		</tr>
		<tr>
			<td height="50" align="center" bgColor="#ffffff">
				<font >当前页:第${pageView.currentpage}页 | 总记录数:${pageView.totalrecord}条 | 每页显示:${pageView.maxresult}条 | 总页数:${pageView.totalpage}页</font>
 				<c:choose> 
 					 <c:when test="${pageView.currentpage==1}"><b><font color="#FFFFFF">第1页</font></c:when>
						 <c:otherwise><a href="javascript:topage('1')" >第1页</a></c:otherwise>
		 				</c:choose> 
		  				<c:if test="${pageView.currentpage>2}"><a href="javascript:topage('${pageView.currentpage-1}')" >上一页</a></c:if> 
		 				 <c:if test="${pageView.currentpage!=1&&pageView.currentpage!=pageView.totalpage}"><b><font color="#FFFFFF">第${pageView.currentpage}页</font></b></c:if> 
		  				 <c:if test="${pageView.currentpage<pageView.totalpage}"><a href="javascript:topage('${pageView.currentpage+1}')" >下一页</a></c:if>
					 <c:choose>
		 			 <c:when test="${pageView.currentpage<pageView.totalpage}"><a href="javascript:topage('${pageView.totalpage}')" >末页</a></c:when>
		  			<c:otherwise><b><font color="#FFFFFF">末页</font></c:otherwise>
					 </c:choose>
			</td>
		</tr>
			 
		 </table>
    
		 </form>
    </body> 
</html>
